package com.cloudknow.healthyRun.activity.common;

import android.view.View;
import android.widget.LinearLayout;

import com.cloudknow.activity.BaseActivity;
import com.cloudknow.common.Constant;
import com.cloudknow.healthyRun.R;
import com.cloudknow.utils.PrefsUtil;

/**
 * Create bu wubin on .
 *
 * @description 角色选择
 */
public class RoleChoiceActivity extends BaseActivity implements View.OnClickListener{
    private String TAG =  getClass().getSimpleName();

    private LinearLayout layout_studio;
    private LinearLayout layout_teacher;

    @Override
    protected int setView() {
        return R.layout.activity_common_role_choice;
    }

    @Override
    protected void receiveData() {

    }

    @Override
    protected void initializeView() {
        initView();
    }

    private void initView() {
        layout_studio = findViewById(R.id.layout_studio);
        layout_teacher = findViewById(R.id.layout_teacher);

        layout_studio.setOnClickListener(this);
        layout_teacher.setOnClickListener(this);
    }

    @Override
    protected void loadDataFromServer() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.layout_studio:
                PrefsUtil.setInt(RoleChoiceActivity.this, Constant.isFirstInstall,3);
                PrefsUtil.setString(RoleChoiceActivity.this, Constant.isRole,Constant.isRole_student);

                openActivity(RoleLoginActivity.class);
                finish();
                break;

            case R.id.layout_teacher:
                PrefsUtil.setInt(RoleChoiceActivity.this, Constant.isFirstInstall,3);
                PrefsUtil.setString(RoleChoiceActivity.this, Constant.isRole,Constant.isRole_teacher);

                openActivity(RoleLoginActivity.class);
                finish();
                break;

            default:
                break;
        }
    }
}
